package model

import "fmt"

// 测试标准 database/sql

type User struct {
	Id   int64  `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	Age  int8   `json:"age,omitempty"`
}

func (u *User) String() string {
	return fmt.Sprintf("User={Id=%d, Name=%s, Age=%d}",
		u.Id, u.Name, u.Age)
}

// 测试转账例子

type Account struct {
	Id      int64  `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Balance int64  `json:"balance,omitempty"`
}

func (a *Account) String() string {
	return fmt.Sprintf("Account={Id=%d, Name=%s, Balance=%d}",
		a.Id, a.Name, a.Balance)
}
